<form action="<?php echo base_url('User/MyAccount/update'); ?>" method="post">

	<h1><?php echo $this->l('Update Your Account'); ?></h1>
    <?php if($this->session->flashdata('successMessage')) : ?>
        <div class="alert alert-success">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <?php echo $this->session->flashdata('successMessage'); ?>
        </div>
    <?php elseif($this->session->flashdata('errorMessage')) : ?>
        <div class="alert alert-error">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <?php echo $this->session->flashdata('errorMessage'); ?>
        </div>
    <?php endif; ?>
	
	<div class="login-fields">
		
		<p><?php echo $this->l('Update your account.'); ?></p>

		<?php if (!empty($patient)){ ?><!-- If is patient we display this form -->
			<div class="field<?php echo (form_error('birthday'))?' error':''; ?>">
				<label for="birthday"><?php echo $this->l('Birthday:'); ?></label>
				<input type="date" id="birthday" name="birthday" 
	                   value="<?php echo set_value('birthday', $patient->birthday); ?>" 
	                   placeholder="<?php echo $this->l('Enter your birthday date'); ?>" class="form-control datepicker" />
	             
	             <?php echo form_error('birthday', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('phone'))?' error':''; ?>">
				<label for="phone"><?php echo $this->l('Phone:'); ?></label>	
				<input type="text" id="phone" name="phone" 
	                   value="<?php echo set_value('phone', $patient->phone); ?>" 
	                   placeholder="<?php echo $this->l('Enter your phone number'); ?>" class="form-control" />
	             
	             <?php echo form_error('phone', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('profession'))?' error':''; ?>">
				<label for="profession"><?php echo $this->l('Profession:'); ?></label>	
				<input type="text" id="profession" name="profession" 
	                   value="<?php echo set_value('profession', $patient->profession); ?>" 
	                   placeholder="<?php echo $this->l('Enter your profession'); ?>" class="form-control" />
	             
	             <?php echo form_error('profession', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('pobox'))?' error':''; ?>">
				<label for="pobox"><?php echo $this->l('P.O.Box:'); ?></label>	
				<input type="text" id="pobox" name="pobox" 
	                   value="<?php echo set_value('pobox', $patient->pobox); ?>" 
	                   placeholder="<?php echo $this->l('Enter your pobox'); ?>" class="form-control" />
	             
	             <?php echo form_error('pobox', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('town'))?' error':''; ?>">
				<label for="town"><?php echo $this->l('Town:'); ?></label>	
				<input type="text" id="town" name="town" 
	                   value="<?php echo set_value('town', $patient->town); ?>" 
	                   placeholder="<?php echo $this->l('Enter your town'); ?>" class="form-control" />
	             
	             <?php echo form_error('town', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('nb_secur_social'))?' error':''; ?>">
				<label for="town"><?php echo $this->l('Social security number:'); ?></label>	
				<input type="text" id="nb_secur_social" name="nb_secur_social" 
	                   value="<?php echo set_value('nb_secur_social', $patient->nb_secur_social); ?>" 
	                   placeholder="<?php echo $this->l('Enter your social security number'); ?>" class="form-control" />
	             
	             <?php echo form_error('nb_secur_social', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
					
			<div class="field<?php echo (form_error('address'))?' error':''; ?>">
				<label for="town"><?php echo $this->l('Address :'); ?></label>	
				<input type="text" id="address" name="address" 
	                   value="<?php echo set_value('address', $patient->address); ?>" 
	                   placeholder="<?php echo $this->l('Enter your address'); ?>" class="form-control" />
	             
	             <?php echo form_error('address', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
	
	<?php } else { ?> <!-- If is doctor we display this form -->

			<div class="field<?php echo (form_error('medical_id'))?' error':''; ?>">
				<label for="birthday"><?php echo $this->l('Medical id:'); ?></label>
				<input type="text" id="medical_id" name="medical_id" 
	                   value="<?php echo set_value('medical_id', $doctor->medical_id); ?>" 
	                   placeholder="<?php echo $this->l('Enter your medical_id'); ?>" class="form-control" />	             
	             <?php echo form_error('profession', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->

			<div class="field<?php echo (form_error('profession'))?' error':''; ?>">
				<label for="birthday"><?php echo $this->l('Profession:'); ?></label>
				<input type="text" id="profession" name="profession" 
	                   value="<?php echo set_value('profession', $doctor->profession); ?>" 
	                   placeholder="<?php echo $this->l('Enter your profession'); ?>" class="form-control" />	             
	             <?php echo form_error('profession', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->
			
			<div class="field<?php echo (form_error('phone'))?' error':''; ?>">
				<label for="phone"><?php echo $this->l('Phone:'); ?></label>	
				<input type="text" id="phone" name="phone" 
	                   value="<?php echo set_value('phone', $doctor->phone); ?>" 
	                   placeholder="<?php echo $this->l('Enter your phone number'); ?>" class="form-control" />	             
	             <?php echo form_error('phone', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->

			<div class="field<?php echo (form_error('address'))?' error':''; ?>">
				<label for="town"><?php echo $this->l('Address :'); ?></label>	
				<input type="text" id="address" name="address" 
	                   value="<?php echo set_value('address', $doctor->address); ?>" 
	                   placeholder="<?php echo $this->l('Enter your address'); ?>" class="form-control" />	             
	             <?php echo form_error('address', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->

			<div class="field<?php echo (form_error('description'))?' error':''; ?>">
				<label for="town"><?php echo $this->l('Description :'); ?></label>	
				<input type="text" id="description" name="description" 
	                   value="<?php echo set_value('description', $doctor->description); ?>" 
	                   placeholder="<?php echo $this->l('Enter your description'); ?>" class="form-control" />	             
	             <?php echo form_error('description', '<span class="error">', '</span>'); ?>
			</div> <!-- /field -->

	<?php } ?><!-- EndIf is patient -->
		</div> <!-- /login-fields -->
	<div class="login-actions">		
		<button class="login-action btn btn-primary" name="btn_submit"><?php echo $this->l('Update'); ?></button>		
	</div> <!-- .actions -->
	
</form>
<script language="text/javascript">
	
</script>